Repository navigation
[Bugfix] Fix depyf incompatibility with Inductor's set_sys_modules - #60873
Merged
AndreasKaratzas merged 2 commits intoOct 30, 2026
Merged
AndreasKaratzas merged 2 commits into
AndreasKaratzas merged 2 commits into
Conversation
depyf's load_by_key_path hook has its signature frozen at (key, path, linemap, attrs), while Inductor also passes set_sys_modules since pytorch#184285. Every compilation that reaches an autotune code block with debug_dump_path set therefore fails. depyf 0.20.0 is the last release upstream published, so patch the hook in vLLM instead: give it **kwargs and forward them, guarded by a signature check so it disables itself if depyf is ever fixed. The existing depyf test reused vLLM's compile cache and so usually verified nothing. Split it out with the cache disabled, and add a CPU-only unit test for the patch itself. Signed-off-by: Stefan Koncarevic <Stefan.Koncarevic@amd.com>
stefankoncarevic
requested review from
BoyuanFeng,
ProExpertProg,
youkaichao and
zou3519
as code owners
October 9, 2026 15:17
|
✅ @stefankoncarevic, CI is now available for this PR.
|
Collaborator
Author
|
/ci run |
|
✅ Triggered Buildkite CI #93870 for commit |
6 tasks
Merged
5 of 6 tasks
Contributor
|
LGTM, thanks! Should resolve the A more definitive fix should belong in |
yzong-rh
approved these changes
Oct 30, 2026
AndreasKaratzas
approved these changes
Oct 30, 2026
Member
|
Merging to unblock CI. |
This was referenced Oct 30, 2026
ChengYM5685
added a commit
to ChengYM5685/vllm
that referenced
this pull request
Oct 31, 2026
Includes the set_sys_modules compatibility fix from vllm-project#60873 and resolves the ModelConfig type import conflict while preserving the MoRI EPv2 changes. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: ChengYM <320424417+ChengYM5685@users.noreply.github.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Any
torch.compilerun withdebug_dump_pathset fails once compilation reaches an autotune code block, because depyf'sload_by_key_pathhook does not accept Inductor'sset_sys_modulesargument. A compatibility shim gives the hook**kwargsand forwards them.Seen on the
PyTorch Fullgraphstep in Buildkite #93716.Claims
InductorError: RuntimeError: Failed to run autotuning code block: patched_load_by_key_path() got an unexpected keyword argument 'set_sys_modules'.test_custom_compile_config, which reuses vLLM's on-disk compile cache, so on a persistent agent it usually verified nothing. It is now a separate test that disables the cache.PyTorch Fullgraphand 11 s onPyTorch Compilation, both against budgets of 90 and 30 minutes. The other six parametrizations keep using the cache.Validation
1× AMD MI355X (gfx950), ROCm 7.2, PyTorch
2.13.0+git733fca1, depyf 0.20.0, vLLM19c0bed584.The last two rows are the ones that matter. The warm pass is why this reached
main: with a populated cache nothing is compiled, depyf's hook is never called, and the test is green. The forced-disable run confirms the new tests measure the fix rather than the environment.Details
depyf.prepare_debugreplacesPyCodeCache.load_by_key_pathwith a hook that dumps each generated kernel before loading it. The hook's signature is frozen at(key, path, linemap, attrs), andgenerate_and_run_autotune_blocknow also passesset_sys_modules. The resultingTypeErroris raised inside theexecof the tuning block, so it surfaces as anInductorErrorabout the autotune block rather than as anything mentioning depyf.Bumping the pin is not available: 0.20.0 is the last release upstream published, its repository has had no commits since that release, and four pull requests have been open without review. The hook is therefore patched in vLLM, in the way depyf already handles this for
lazy_format_graph_code: accept**kwargsand forward them.The shim forwards the keyword rather than dropping it. Dropping it would also make the call succeed, while quietly reintroducing the
sys.modulesexhaustion that pytorch#184285 fixed; one of the unit tests pins exactly that. Both vLLM entry points into depyf go through the shim, so neither can miss the patch.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.